/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Helper;

import java.io.File;
import javax.swing.filechooser.FileFilter;

/**
 *
 * @author Marco
 */
public class ImageFilter extends FileFilter {
public boolean accept(File f) {
    if (f.isDirectory()) {
	return true;
    }

    String extension = Extensions.getExtension(f);
    if (extension != null) {
	if (extension.equals(Extensions.tiff) ||
	    extension.equals(Extensions.tif) ||
	    extension.equals(Extensions.gif) ||
	    extension.equals(Extensions.jpeg) ||
	    extension.equals(Extensions.jpg) ||
	    extension.equals(Extensions.png)) {
	        return true;
	} else {
	    return false;
	}
    }

    return false;
}

    @Override
    public String getDescription() {
        return "Filtert Imagefiles";
    }

}
